<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
<button>开始</button>
<p>天选之子：</p>
<script type="text/javascript">
	
	let data = ['黄烟尘','木灵希','纪梵心','白卿儿','洛姬','池瑶','元笙','罗乷','凌飞羽','阎折仙','潋曦','敖玲珑','鱼晨静','夏瑜']
	let btn = document.querySelector('button')
	let p = document.querySelector('p')

	let time = null
	let num = null

	btn.onclick = function() {
		if(btn.innerText == '开始'){
			btn.innerText = '结束'
			time = setInterval(function(){
				num = parseInt(Math.random()*data.length)
				p.innerText = data[num]
		},100)
		}else{
			btn.innerText = '开始'
			clearInterval(time)
			data.splice(num,1)
			console.log(data.length)
		}
	}
</script>
</body>
</html>